import React from 'react'
import { withRouter } from 'react-router-dom'
import { Card } from "antd-mobile"
import shop from "../../../../assets/img/16@3x.png"
import "./seckill.less"

function seckill(props) {
    let { seckill, pre } = props
    return (
        <div className='seckill'>
            <Card title='2重利 秒杀特价商品专区 （限量供应，先到先得）' onClick={() => { }}>
                {seckill.length > 0 ? (
                    <>
                        {seckill.map((item) => {
                            return (
                                <div className='seckill_div' key={item.id} onClick={() => {  props.history.push("/detail/" + item.id+"/type=1") }}>
                                    <img src={pre + item.img} alt="" />
                                    <div>
                                        <div>
                                            <p>￥{item.price}</p>
                                            <p>￥{item.market_price}</p>
                                        </div>
                                        <img src={shop} alt="" />
                                    </div>
                                </div>
                            )
                        })}
                    </>
                ):<div>暂无数据</div>}
            </Card>
        </div>
    )
}
export default withRouter(seckill)